#!/usr/bin/python
# This file is part of KEmuFuzzer.
# 
# KEmuFuzzer is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
# 
# KEmuFuzzer is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along with
# KEmuFuzzer.  If not, see <http://www.gnu.org/licenses/>.

import sys, os
from tc import tcgen

# Globals
KEMUFUZZER_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(KEMUFUZZER_PATH)

KERNEL_IMG = os.path.join(KEMUFUZZER_PATH, "kernel/kernel")
FLOPPY_IMG = os.path.join(KEMUFUZZER_PATH, "kernel/floppy.img")

if __name__ == "__main__":
    f = sys.argv[1]
    if len(sys.argv) > 2:
        KERNEL_IMG = sys.argv[2]
    if len(sys.argv) > 3:
        FLOPPY_IMG = sys.argv[3]
    print tcgen(f, KERNEL_IMG, FLOPPY_IMG)
